<!--
 * @Descripttion: 
 * @version: 
 * @Author: Garrison
 * @Date: 2024-03-23 19:08:35
 * @LastEditors: sueRimn
 * @LastEditTime: 2024-04-09 17:06:24
-->
<template>
  <a-card title="比赛列表">
    <a-badge-ribbon
      style="width: 80px"
      v-for="(item, index) in visibleContents.values"
      :key="item"
      text="Prossing"
    >
      <!-- Ant Card设置函数的写法 -->
      <a-card
        :style="index == 0 ? { marginTop: '0px' } : { marginTop: '16px' }"
        hoverable="true"
        @click.native="toContentInfo"
      >
        <!-- Ant Design Vue给a-card标题添加a-icon图标 -->
        <template #title> <TrophyTwoTone />{{ item["title"] }} </template>
        <template #extra>
          <!-- <a style="margin-right: 60px" href="#">{{}}+点击进入</a> -->
        </template>
        startTime:{{ item["startTime"] }}
      </a-card>
    </a-badge-ribbon>
    <!-- <template #actions
      ><a-pagination v-model:current="current" simple :total="50"
    /></template> -->
  </a-card>
</template>
<script lang="ts" setup>
import { userAccess } from "@/components/scriptsFiles/access";
import { TrophyTwoTone } from "@ant-design/icons-vue";
import { useRouter } from "vue-router";
import { onMounted, ref } from "vue";
import { ContestControllerService } from "../../generated";
import {reactive} from "vue"
const current = ref<number>(1);
const router = useRouter();
const toContentInfo = () => {
  console.log(111);

  router.push("/contentInfo");
};
/**
 * @name: 获取比赛列表
 * @return {Array}
 */
const visibleContents = reactive([]);
const getContentsList = async () => {
  const res = await ContestControllerService.getByUserUsingGet();
  if (res.code === 0) {
    visibleContents.values = res.data;
    console.log(visibleContents);
  } else {
    alert("比赛加载失败，请刷新重试！");
  }
};
/**
 * @name: 查询比赛状态
 * @test: test font
 * @msg:
 * @return {*}
 */
const contentStatus = () => {
  return "End";
};
onMounted(() => {
  getContentsList();
});
</script>
<style></style>
